<HTML><HEAD><TITLE>argv(+N, -Argument)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Operating System</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>argv(+N, -Argument)</H1>
Succeeds if the Nth argument given on the command line when invoking
ECLiPSe is the string Argument.


<DL>
<DT><EM>N</EM></DT>
<DD>Integer or the atom all.
</DD>
<DT><EM>Argument</EM></DT>
<DD>String, List or variable.
</DD>
</DL>
<H2>Description</H2>
   Used to find any argument used when invoking ECLiPSe at the operating
   system prompt.  The zero'th argument is the name of the eclipse binary.
   When N is the atom all, then a list of all arguments is returned instead
   of a single argument.  When the command line contains the special
   argument --, then all arguments before and including that one are
   suppressed.

<P>

<H3>Modes and Determinism</H3><UL>
<LI>argv(+, -) is det
</UL>
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>N is not instantiated.
<DT><EM>(5) type error </EM>
<DD>N is not an integer or an atom.
<DT><EM>(6) out of range </EM>
<DD>N is an atom different from all.
<DT><EM>(6) out of range </EM>
<DD>There was not N arguments when calling ECLiPSe .
</DL>
<H2>Examples</H2>
<PRE>
Success:
   % eclipse hello world
   [eclipse]: argv(0,A0), argv(1,A1), argv(2,A2).
   A0 = "/usr/local/eclipse/bin/sun4/eclipse.exe"
   A1 = "hello"
   A2 = "world"
   yes.
   [eclipse]: argv(all, [_A0|Args]).
   Args = ["hello", "world"]
   yes.
   % eclipse -e "argv(all,[_|A]),writeq(A),nl" -- hello world
   ["hello", "world"]
Error:
   argv(N,A).                     (Error 4).
   argv(1.0,A).                   (Error 5).
   argv(-1,A).                    (Error 6).



</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/opsys/argc-1.html">argc / 1</A>
</BODY></HTML>
